FROM python:3.10

RUN mkdir /src

COPY ./response_selectors/ranking_and_intent_based_response_selector/requirements.txt /src/requirements.txt
RUN pip install -r /src/requirements.txt

ARG SERVICE_PORT
ENV SERVICE_PORT ${SERVICE_PORT}
ARG SENTENCE_RANKER_ANNOTATION_NAME
ENV SENTENCE_RANKER_ANNOTATION_NAME ${SENTENCE_RANKER_ANNOTATION_NAME}
ARG SENTENCE_RANKER_SERVICE_URL
ENV SENTENCE_RANKER_SERVICE_URL ${SENTENCE_RANKER_SERVICE_URL}
ARG SENTENCE_RANKER_TIMEOUT
ENV SENTENCE_RANKER_TIMEOUT ${SENTENCE_RANKER_TIMEOUT}
ARG N_UTTERANCES_CONTEXT=5
ENV N_UTTERANCES_CONTEXT ${N_UTTERANCES_CONTEXT}
ARG FILTER_TOXIC_OR_BADLISTED=1
ENV FILTER_TOXIC_OR_BADLISTED ${FILTER_TOXIC_OR_BADLISTED}

COPY ./response_selectors/ranking_and_intent_based_response_selector/ /src/
WORKDIR /src
COPY ./common/ ./common/


CMD gunicorn --workers=1 server:app -b 0.0.0.0:${SERVICE_PORT} --timeout=1200
